package com.patterns.demo.observer.second;

import com.patterns.demo.observer.second.observer.Observer;

import java.util.ArrayList;
import java.util.List;

/**
 * Author: SamGroves
 * <p>
 * Description:
 * <p>
 * Date: 2018/1/29
 */
public class Kid {

    public boolean sleepping = true;

     List<Observer> observers = new ArrayList<>();

    public void  wakeUp() {
        WakeUpEvent event = new WakeUpEvent(6, this);
        observers.forEach((observer) -> {
            observer.handWakeUp(event);
        });
    }
}
